package cqie.personal.frame.mapper;

import cqie.personal.frame.entity.ClassInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.Date;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Yeeeeee
 * @since 2021-09-28
 */
@Mapper
public interface ClassInfoMapper extends BaseMapper<ClassInfo> {

    @Insert(" INSERT INTO course_class_user" +
            " ( class_id, teacher_uid, course_id, create_time, create_person, last_upgrade_time, last_upgrade_person) " +
            " VALUE(#{classId} , #{teacherUid} , #{courseId} , #{date} , #{operator} , #{date} , #{operator})")
    Integer addNewCourseIntoClass(Integer courseId, Integer classId, Integer teacherUid, Integer operator, Date date);

    @Delete(" DELETE FROM course_class_user WHERE id = #{id}")
    Integer removeCourseFormClass(Integer id);
}
